﻿using AbpVnext_Module.Iservice;
using AbpVnext_Module.Repository;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;

namespace AbpVnext_Module.Service
{
    [Dependency(ServiceLifetime.Transient)]
    public class ProductService : IProductService
    {
        //public IProductImageRepository ProductImageRepository { get; set; }
        
        public ProductService()
        {

        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="product"></param>
        /// <returns></returns>
        public string InsertProduct(Product product)
        {
            #region  普通添加
            //Context.Product.Add(product);
            //Context.SaveChanges();
            return "添加成功";
            #endregion

            #region  abp仓储层添加
            //ProductImage image = new ProductImage();
            //image.Url = product.Name;
            //image.ProductId = 10;
            //var productImage = ProductImageRepository.InsertAsync(image);
            //return "添加成功";
            #endregion
        }
    }
}
